package com.weigee.ktv.view.fragment

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.bumptech.glide.Glide
import com.linde.library.activities.MyFragmentActivity
import com.linde.library.util.DisplayUtil
import com.linde.library.util.ToastUtil
import com.weigee.ktv.R
import com.weigee.ktv.model.enums.ImagePreLoad
import com.weigee.ktv.model.enums.WeigeeHost
import kotlinx.android.synthetic.main.fragment_main_left_menu.*

/**
 * Created by linde on 2017/5/28.
 *<p/>
 */
class MainLeftMenuFragment : BaseFragment()
{
    override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View?
    {
        return inflater?.inflate(R.layout.fragment_main_left_menu, container, false)
    }

    override fun onViewCreated(view: View?, savedInstanceState: Bundle?)
    {
        super.onViewCreated(view, savedInstanceState)
        DisplayUtil.setStatusBarHeight(linear_left_menu_top)

        Glide.with(activity).load(WeigeeHost.TEST_IMAGE.url).asBitmap().placeholder(ImagePreLoad.IMAGE.res).into(iv_portrait)
        iv_portrait.setOnClickListener({ v ->
            ToastUtil.show(v, "这是头像")
        })

        menu_tv_wallet.setOnClickListener({
            MyFragmentActivity.start(activity, WalletFragment::class.java)
        })
        menu_tv_msg.setOnClickListener({
            MyFragmentActivity.start(activity, NotificationFragment::class.java)
        })
        menu_tv_customer_service.setOnClickListener({ v ->
            MyFragmentActivity.start(activity, CustomerServiceCenterFragment::class.java)
        })
        menu_tv_others.setOnClickListener({ v ->
            ToastUtil.show(v, "其他")
        })
    }
}